﻿<%@ 
EnableSessionState=false
Language=JScript 
%>

<%

Response.CodePage = 65001;
Response.CharSet = "utf-8";

var xmlstrInput = Request.Form("xmldata");
var xmlInputDoc = new ActiveXObject("MSXML2.DOMDocument");
xmlInputDoc.async = false;
xmlInputDoc.loadXML(xmlstrInput);
var topNode = xmlInputDoc.documentElement;

var outputText = "";
outputText = outputText + topNode.nodeName + "\n";

var parentNode = topNode;
var childNode;
var childCount;
if( parentNode.hasChildNodes() ) 
{
	childCount = parentNode.childNodes.length;
	outputText = outputText + "childCount:" + childCount + "\n";
	
	for( i=0; i < childCount; i++ )
	{
		childNode = parentNode.childNodes(i);
		outputText = outputText + "> name: " + childNode.nodeName + "\n";
		if( childNode.firstChild != null )
		{
			outputText = outputText + "> value: " + childNode.firstChild.nodeValue + "\n";
		}
	}
}

xmlInputDoc = null;

Response.ContentType = "text/plain";
Response.Write(outputText);

%>

